<%@ page import="java.util.List,java.util.ArrayList,com.example.javaWebWK2.Brand" %>
 <%-- Created by IntelliJ IDEA.
  User: shisjin
  Date: 2023/9/19
  Time: 15:15
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
  List<Brand> brandList =new ArrayList<>();
  Brand brand1 = new Brand(1, "三只松鼠", "三只松鼠", 100, "三只松鼠，好吃不上火", 1);
  Brand brand2 = new Brand(2, "优衣库", "优衣库", 10, "优衣库，服适人生", 0);
  Brand brand3 = new Brand(3, "小米", "小米科技有限公司", 1000, "为发烧而生", 1);
  brandList.add(brand1);
  brandList.add(brand2);
  brandList.add(brand3);
%>
<html>
<head>
    <title>Title</title>
</head>
<body>
<table border="1" cellspacing="0" width="800">
  <tr>
    <th>序号</th>
    <th>品牌名称</th>
    <th>企业名称</th>
    <th>排序</th>
    <th>品牌介绍</th>
    <th>状态</th>
    <th>操作</th>
  </tr>
  <%
    for (int i = 0; i < brandList.size(); i++) {
      Brand brand =brandList.get(i);
  %>

      <tr align="center">
        <td><%=brand.getId()%></td>
        <td><%=brand.getBrandName()%></td>
        <td><%=brand.getCompanyName()%></td>
        <td><%=brand.getOrdered()%></td>
        <td><%=brand.getDescription()%></td>
        <%if (brand.getStatus()==1) {%>
           <td><%="启用"%></td>
        <% }else{%>
        <td><%="禁用"%></td>
        <%}%>

        <td><a href="#">修改</a> <a href="#">删除</a></td>
     </tr>

  <%  }%>


<%--  <tr align="center">--%>
<%--    <td>2</td>--%>
<%--    <td>优衣库</td>--%>
<%--    <td>优衣库</td>--%>
<%--    <td>10</td>--%>
<%--    <td>优衣库，服适人生</td>--%>
<%--    <td>禁用</td>--%>

<%--    <td><a href="#">修改</a> <a href="#">删除</a></td>--%>
<%--  </tr>--%>

<%--  <tr align="center">--%>
<%--    <td>3</td>--%>
<%--    <td>小米</td>--%>
<%--    <td>小米科技有限公司</td>--%>
<%--    <td>1000</td>--%>
<%--    <td>为发烧而生</td>--%>
<%--    <td>启用</td>--%>

<%--    <td><a href="#">修改</a> <a href="#">删除</a></td>--%>
<%--  </tr>--%>
</table>
</body>
</html>
